package com.coreJava.meiju;

/**
 * 作者: LCG
 * 日期: 2020/2/13 00:04
 * 描述:
 */
public enum MeiJuStatus {

    TEST1(0,"状态1"),TEST2(1,"状态2"),TEST3(2,"状态3");

    private int code;

    private String message;

    MeiJuStatus(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessageByCode(int code){
        MeiJuStatus[] values = MeiJuStatus.values();
        for(MeiJuStatus ms:values){
           if(ms.code==code){
               return ms.message;
           }
        }

        return null;
    }

}
